class Solution:

    def longestString(self, x: int, y: int, z: int) -> int:
        return z * 2 + min(x, y) * 4 + (2 if x > min(x, y) or y > min(x, y) else 0)

s = Solution()
print(s.longestString(9,9,34))